using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using SiteECSWeb;
using System.Web.Services;
using System.Web.Script.Services;
using System.Collections.Generic;

public partial class MarketStudies_MStudyDefault : PageBase
{
   
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    #region WebServiceMethod
    [WebMethod]
    [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
    //[GenerateScriptType(typeof(OfficeInfo))]
    public static List<MarketStudyInfo> GetMStudyItems(int pageindex, int pagesize)
    {
        MStudyBLL msAPI = new MStudyBLL();

        EcsSiteDS.MStudyDataTable mstable = msAPI.GetAllMStudyData();
        List<MarketStudyInfo> MStudyInfo = new List<MarketStudyInfo>();
        foreach (EcsSiteDS.MStudyRow smRow in mstable)
        {
            MStudyInfo.Add(new
                MarketStudyInfo
                (smRow.Mstdy_id, smRow.Mstdy_name, smRow.Mstdy_memo, smRow.ProdCat_NameAr,
                smRow.CountryNmAr, smRow.CountryNmEn,
                (smRow.IsMstdy_ImagePathNull() ? string.Empty : smRow.Mstdy_ImagePath),
                smRow.Mstdy_date));
        }
        return MStudyInfo.GetRange((pageindex - 1 * pagesize), pagesize);
    }
    #endregion
}
